import React, { Component } from "react";
import { Select, Input } from "antd";
const Option = Select.Option;
const InputGroup = Input.Group;
const Search = Input.Search;
export default class StudentsSearch extends Component {
    constructor(){
        super();
        this.state = {
            type:"name"
        }
    }
    selectType = (value) => {
        this.setState({
            type:value
        })
    }
    search = (value) => {
        
        this.props.show(1,5,this.state.type,value);
    }
    render() {
        return (
            <div>
                <InputGroup compact>
                    <Select defaultValue={this.state.type} onChange={this.selectType} style={{ width: 90 }}>
                        <Option value="name">姓名</Option>
                        <Option value="gender">性别</Option>
                        <Option value="age">年龄</Option>
                    </Select>
                    <Search
                        placeholder="input search text"
                        onSearch={this.search}
                        style={{ width: 200 }}
                    />
                </InputGroup>
            </div>
        );
    }
}
